/**
 * 
 */
package com.maohi.software.tupuna.home.bundle.modules;

import java.awt.Component;

import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import com.google.inject.AbstractModule;
import com.google.inject.name.Names;
import com.maohi.software.tupuna.constants.UIConstant;
import com.maohi.software.tupuna.home.bundle.ui.BundleContentUI;
import com.maohi.software.tupuna.home.bundle.ui.BundleMenuUI;
import com.maohi.software.tupuna.home.bundle.ui.BundleToolBarUI;
import com.maohi.software.tupuna.home.bundle.ui.BundleUI;
import com.maohi.software.tupuna.home.bundle.ui.HomeUI;
import com.maohi.software.tupuna.interfaces.BundleApi;

/**
 * @author heifara
 * 
 */
public class BundleModule extends AbstractModule {

	private String bundleId;

	public BundleModule() {
		this.bundleId = "";
	}

	public BundleModule(String aBundleId) {
		this.bundleId = aBundleId;
	}

	@Override
	protected void configure() {

		this.bind(BundleApi.class).to(BundleUI.class);

		this.bind(String.class).annotatedWith(Names.named("bundle")).toInstance(this.bundleId);

		this.bind(JPanel.class).annotatedWith(Names.named(UIConstant.HOME_UI)).to(HomeUI.class);
		this.bind(Component.class).annotatedWith(Names.named(UIConstant.BUNDLE_MENU_UI)).to(BundleMenuUI.class);
		this.bind(Component.class).annotatedWith(Names.named(UIConstant.BUNDLE_TOOLBAR_UI)).to(BundleToolBarUI.class);
		this.bind(JTabbedPane.class).annotatedWith(Names.named(UIConstant.BUNDLE_CONTENT_UI)).to(BundleContentUI.class);
	}

}
